package com.wz.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangze
 * @date 2018-02-27 9:21.
 **/
@Controller
public class HelloController {


@RequestMapping(value = "hello/index",method = RequestMethod.GET)
@ResponseBody
  public   String index() {
        return "hello1";
    }


    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public String test(Model model) {
        model.addAttribute("name", "Dear");
        return "hello";
    }
}






